﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CashierSystem.UserManager;

namespace CashierSystem.remindManager
{
    public partial class NewRemindForm : Form
    {
        User user;
        public NewRemindForm(User user)
        {
            this.user = user;
            InitializeComponent();
        }

        private void dtpRemindDate_ValueChanged(object sender, EventArgs e)
        {
            tbRemindDate.Text = dtpRemindDate.Value.Date.ToString().Substring(0,10);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string remindContent = rtbRemindContent.Text;
            string date = tbRemindDate.Text;
            DateTime d = DateTime.Parse(date);
            string sd = d.ToString("yyyy-MM-dd");
            UserRemindManager.saveRemind(remindContent, sd, user.getAccount());
            DialogResult response = MessageBox.Show("设置提醒成功！");
            
        }

    }
}